Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use registry to find linked batteries for homekit #33519

Merged
merged 14 commits into from
Apr 22, 2020

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Apr 2, 2020

Proposed change

Battery level is found in the following order:

  1. Specified linked battery sensor via config (existing)
  2. ATTR_BATTERY_LEVEL on the entity (existing)
  3. Matched sensor with DEVICE_CLASS_BATTERY in the registry for the device

Battery charging state is found in the following order:

  1. Specified linked battery charging sensor via config
  2. ATTR_BATTERY_CHARGING on the Specified linked battery sensor via config (existing)
  3. ATTR_BATTERY_CHARGING on the entity (existing)
  4. Matched binary_sensor with DEVICE_CLASS_BATTERY_CHARGING in the registry for the device

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example entry for configuration.yaml:

# Example configuration.yaml

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 馃 Silver
  • 馃 Gold
  • 馃弳 Platinum

@bdraco
Copy link
Member Author

bdraco commented Apr 9, 2020

Will come back to this on the weekend when I have a larger chunk of time.

@bdraco
Copy link
Member Author

bdraco commented Apr 12, 2020

I'm going to come back to this once all the homekit PRs I have pending review are merged to avoid the conflict

@bdraco bdraco force-pushed the homekit_find_linked_batteries branch from 79dcaf9 to 96304da Compare April 13, 2020 02:54
@bdraco
Copy link
Member Author

bdraco commented Apr 13, 2020

Fixed all the conflicts, now going to do a break out of binary sensor for the arch change. Then I'll add a lot more tests and optimize.

@bdraco bdraco force-pushed the homekit_find_linked_batteries branch 6 times, most recently from ee6a301 to e71c2e1 Compare April 17, 2020 05:03
@bdraco bdraco force-pushed the homekit_find_linked_batteries branch from cc9e26b to be6504f Compare April 18, 2020 18:38
@bdraco bdraco marked this pull request as ready for review April 18, 2020 18:42
@bdraco
Copy link
Member Author

bdraco commented Apr 18, 2020

I wanted another device to test this with so I added vacuum support so I could test with my roomba #34386

@bdraco bdraco force-pushed the homekit_find_linked_batteries branch 3 times, most recently from 8923ec1 to 4db9daa Compare April 19, 2020 23:20
@bdraco bdraco force-pushed the homekit_find_linked_batteries branch 2 times, most recently from 84c1c55 to d305b58 Compare April 20, 2020 20:05
@bdraco bdraco requested a review from balloob April 20, 2020 21:01
@bdraco bdraco force-pushed the homekit_find_linked_batteries branch from d305b58 to 0bad701 Compare April 21, 2020 16:40
@bdraco
Copy link
Member Author

bdraco commented Apr 21, 2020

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@bdraco bdraco force-pushed the homekit_find_linked_batteries branch from 0bad701 to 74c47af Compare April 21, 2020 23:59
Dev automation moved this from Incoming to Reviewer approved Apr 22, 2020
@balloob balloob merged commit 96649a7 into home-assistant:dev Apr 22, 2020
Dev automation moved this from Reviewer approved to Done Apr 22, 2020
@lock lock bot locked and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Dev
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants